#import <Foundation/Foundation.h>
#import "MyObjcClass.h"
#import "smart_ptr.hpp"
#import <iostream>
#import <vector>


int main (int argc, const char * argv[]) 
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

	{
		MyObjcClass * myClass = [[MyObjcClass alloc] init];
		[myClass setData:66];
		myClass.Bar = 88;
		NSLog(@"data: %d", [myClass getData]);
		NSLog(@"Bar: %d", myClass.Bar);
		[myClass release];
		//NSLog(@"data: %d", [myClass getData]);		//deberia lanzar error en runtime
	}
	
	{
	
		//smart_ptr<MyObjcClass> myClass ( [[MyObjcClass alloc] init] );
		smart_ptr<MyObjcClass> myClass = [[MyObjcClass alloc] init];
	
		
		[myClass.get() setData:77];

		//[myClass setData:77];

		myClass.get().Bar = 88;
		
				
		NSLog(@"data: %d", [myClass.get() getData]);
		NSLog(@"Bar: %d", myClass.get().Bar);
	}
	
	{
		
		smart_ptr<MyObjcClass> myClassGuard = [[MyObjcClass alloc] init];

		auto myClass = myClassGuard.get();
		
		[myClass setData:77];
		
		myClass.Bar = 88;
		
		
		NSLog(@"data: %d", [myClass getData]);
		NSLog(@"Bar: %d", myClass.Bar);
	}	
	
	
	
	
	{
		std::cout << "hello world!" << std::endl;
	}
	
	{
		auto f = []{ std::cout << "hello world!" << std::endl;};
		f();
	}	
	
	
	{
		
		std::vector<int> vecInt;
	}
	
	
    [pool drain];
    return 0;
}
